package com.yanqu.road.server.manger.activity.shrek;

import com.yanqu.road.entity.activity.ActivityConfig;
import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.activity.douluoshrek.*;
import com.yanqu.road.entity.activity.shrek.DouLuoShrekEventData;
import com.yanqu.road.entity.activity.shrek.DouLuoShrekStudentData;
import com.yanqu.road.entity.enums.eActivityType;
import com.yanqu.road.entity.enums.eSystemId;
import com.yanqu.road.logic.bussiness.activity.DouLuoShrekBusiness;
import com.yanqu.road.pb.activity.DouLuoShrekProto;
import com.yanqu.road.server.TempMgr;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.shrek.DouLuoShrekModule;
import com.yanqu.road.server.manger.ServerLanguageMgr;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.manger.activity.NormalActivityMgr;
import com.yanqu.road.server.manger.config.SystemOpenMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.utils.RandomHelper;
import com.yanqu.road.utils.property.Property;
import com.yanqu.road.utils.property.PropertyHelper;
import com.yanqu.road.utils.string.StringUtils;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public class DouLuoShrekMgr extends TempMgr {

    private static RandomHelper randomHelper = new RandomHelper();

    private static ActivityInfo activityInfo;

    private static Map<Integer, Map<Integer, SkillConfig>> skillConfigMap;
    private static Map<Integer, Map<Integer, CounterConfig>> counterConfigMap;
    private static Map<Integer, TitleConfig> titleConfigMap;
    private static Map<Integer, BeastConfig> beastConfigMap;
    private static Map<Integer, EventConfig> eventConfigMap;

    //学院建筑时间表 编号，进去时间毫秒，开始时间到进去的经过时间（不用等待的进入时间）
    private static Map<Integer,Long> buildingEnterTimeMap = new ConcurrentHashMap<>();

    //学院建筑时间表 编号，学习时间毫秒，学习持续的经过时间
    private static Map<Integer,Long> buildingStudyTimeMap = new ConcurrentHashMap<>();

    //学院建筑座位表 编号，等级对应多少个坑位
    private static Map<Integer,Map<Integer,Integer>> buildingSeatMap = new ConcurrentHashMap<>();

    //招生办建筑id
    private static int enrolBuildingId = 1;

    //魂力检测建筑id
    private static int soulCheckBuildingId = 2;

    //积分道具
    private static int COLLEGE_SCORE_ITEM_ID = 101989;
    //惊魂币
    private static int COLLEGE_COST_NUM_ID = 120658;

    //排队人数
    private static String COLLEGE_QUEUE_NUM = "4|4|5|5|5|5|5";

    private static Map<Integer,Long> processTimeMap;
    //各个学院处理时间/s（招生办|武魂检测|辅助系|敏攻系|食物系|远攻系|强攻系）
    private static String COLLEGE_PROCESS_TIME = "60000|50000|40000|80000|90000|70000|50000";

    private static Map<Integer,Long> walkTimeMap;
    //各学院间走路时间/s（门口|招生办|武魂检测|辅助系|敏攻系|食物系|远攻系|强攻系）
    private static String COLLEGE_WALK_TIME = "5000|4000|3000|6000|7000|4000|5000";

    //柜台解锁时间/s
    private static long COLLEGE_COUNTER_UNLOCK_TIME = 5 * 1000;

    //武魂的种类个数
    private static int COLLEGE_SKILL_NAME_NUM = 100;

    //事件刷新时间
    private static long COLLEGE_EVENT_REFRESH_TIME = 6*60*60*1000;

    private static long COLLEGE_BATTLE_QUICK_OPEN_LIMIT = 5000;

    public static void setStudyTime(DouLuoShrekStudentData student,int buildingId,long studyTime){
        Map<Integer,Long> studyTimeMap = student.getStudyTimeMap();
        Map<Integer,Long> enterTimeMap = student.getEnterTimeMap();
        long loseTime = studyTimeMap.get(buildingId) - studyTime;
        studyTimeMap.put(buildingId,studyTime);
        for(int bId : enterTimeMap.keySet()){
            if(bId > buildingId){
                enterTimeMap.put(bId,enterTimeMap.get(bId) - loseTime);
            }
        }
    }

    //获取加速的消耗当前结算对应的魂力的头衔
    public static Property getAccelerateTimeCost(Map<Integer,Long> leftSoulMap,Map<Integer,Long> rightSoulMap,int studyBuildingId){
        long leftSoulValue = 0,rightSoulValue = 0;
        for(int buildingId : leftSoulMap.keySet()){
            if(buildingId < studyBuildingId){
                leftSoulValue += leftSoulMap.get(buildingId);
            }
        }
        for(int buildingId : rightSoulMap.keySet()){
            if(buildingId < studyBuildingId){
                rightSoulValue += leftSoulMap.get(buildingId);
            }
        }
        TitleConfig titleConfig = getTitleConfigBySoul(leftSoulValue > rightSoulValue ? leftSoulValue:rightSoulValue);
        if(titleConfig == null){
            getLogger().error("斗罗史莱克学院配置异常，出现了找不到加速消耗的配置");
            return PropertyHelper.parseStringToProperty(COLLEGE_COST_NUM_ID + "=" + Integer.MAX_VALUE);
        }
        return PropertyHelper.parseStringToProperty(COLLEGE_COST_NUM_ID + "=" + titleConfig.getAccelerateTimeCost());
    }

    public static List<String> getEventConfigRewardList(int eventId){
        return eventConfigMap.get(eventId).getRewardList();
    }

    //随机一个空的建筑的不存在的随机事件
    public static DouLuoShrekEventData randomBuildingEvent(Map<Integer, DouLuoShrekEventData> userEventMap,long eventTime){
        List<Integer> buildingIdList = new ArrayList<>();
        Map<Integer,EventConfig> eventMap = new ConcurrentHashMap<>(eventConfigMap);
        for(DouLuoShrekEventData userEvent : userEventMap.values()){
            if(userEvent.getEventId() == 0){
                buildingIdList.add(userEvent.getBuildingId());
            }
            if(userEvent.getEventId() != 0){
                eventMap.remove(userEvent.getEventId());
            }
        }
        if(buildingIdList.size() > 0){
            int randomBuildingIndex = randomHelper.next(0,buildingIdList.size());
            int randomEventIndex = randomHelper.next(0,eventMap.size());
            int buildingId = buildingIdList.get(randomBuildingIndex);
            int eventId = new ArrayList<>(eventMap.keySet()).get(randomEventIndex);
            userEventMap.get(buildingId).setEventId(eventId);
            userEventMap.get(buildingId).setEventTime(eventTime);
            return userEventMap.get(buildingId);
        }
        return null;
    }

    public static long getEventRefreshTime(){
        return COLLEGE_EVENT_REFRESH_TIME;
    }

    public static int getBossKillTimes(int bossId){
        BeastConfig beastConfig = beastConfigMap.get(bossId);
        return beastConfig.getKillTimes();
    }

    public static int getNextBossId(int nowBossId){
        int tempBossId = Integer.MAX_VALUE;
        for(BeastConfig beastConfig : beastConfigMap.values()){
            if(beastConfig.getId() > nowBossId && beastConfig.getId() < tempBossId){
                tempBossId = beastConfig.getId();
            }
        }
        //返回0表示boss死光了
        if(tempBossId == Integer.MAX_VALUE){
            return 0;
        }
        return tempBossId;
    }

    public static BigInteger getBossBlood(int bossId){
        BeastConfig beastConfig = beastConfigMap.get(bossId);
        return beastConfig.getBlood();
    }

    public static Property getSolderBeatRewards(long soulValue){
        Property property = new Property();
        for(TitleConfig titleConfig : titleConfigMap.values()){
            if(soulValue >= titleConfig.getSmallValue() && soulValue < titleConfig.getBigValue()){
                return PropertyHelper.parseStringToProperty(titleConfig.getRewards());
            }
        }
        return property;
    }

    public static TitleConfig getTitleConfigBySoul(long soulValue){
        for(TitleConfig titleConfig : titleConfigMap.values()){
            if(soulValue >= titleConfig.getSmallValue() && soulValue < titleConfig.getBigValue()){
                return titleConfig;
            }
        }
        return null;
    }

    public static Property getBossRewards(int boosId){
        return PropertyHelper.parseStringToProperty(beastConfigMap.get(boosId).getRewards());
    }

    public static Boolean isEnrolBuildingId(int buildingId){
        return buildingId == enrolBuildingId;
    }

    public static int getEnrolBuildingId(){
        return enrolBuildingId;
    }

    public static int getSoulCheckBuildingId(){
        return soulCheckBuildingId;
    }

    public static long getCollegeBattleQuickOpenLimit(){
        return COLLEGE_BATTLE_QUICK_OPEN_LIMIT;
    }

    public static int getShuangTypeRandom(int buildingLevel){
        Map<Integer,SkillConfig> skillConfigMap = DouLuoShrekMgr.skillConfigMap.get(soulCheckBuildingId);
        SkillConfig skillConfig = skillConfigMap.get(buildingLevel);
        int randomValue = randomHelper.next(0,1000);
        if(skillConfig.getWeight() > randomValue){
            return 2;
        }
        return 1;
    }

    //获取学生武魂类型
    public static int getRandomSoulType(int notThisOne){
        int randomValue = 0;
        if(notThisOne == 0){
            randomValue = randomHelper.next(1,COLLEGE_SKILL_NAME_NUM + 1);
        }else{
            randomValue = randomHelper.next(1,COLLEGE_SKILL_NAME_NUM);
            if(randomValue >= notThisOne){
                randomValue++;
            }
        }
        return randomValue;
    }

    public static Boolean isSoulCheckBuildingId(int buildingId){
        return buildingId == soulCheckBuildingId;
    }

    public static int getCollegeScoreItemId(){
        return COLLEGE_SCORE_ITEM_ID;
    }

    public static int getJinHunBiItemId(){
        return COLLEGE_COST_NUM_ID;
    }

    public static String getJinHunBiReward(int num){
        return COLLEGE_COST_NUM_ID + "=" + num;
    }

    public static CounterConfig getBuildingConfig(int buildingId,int level){
        if(!counterConfigMap.containsKey(buildingId)){
            return null;
        }
        Map<Integer,CounterConfig> counterConfigMap = DouLuoShrekMgr.counterConfigMap.get(buildingId);
        if(!counterConfigMap.containsKey(level)){
            return null;
        }
        return counterConfigMap.get(level);
    }

    public static SkillConfig getSkillConfig(int buildingId,int level){
        if(!skillConfigMap.containsKey(buildingId)){
            return null;
        }
        Map<Integer,SkillConfig> skillConfigMap = DouLuoShrekMgr.skillConfigMap.get(buildingId);
        if(!skillConfigMap.containsKey(level)){
            return null;
        }
        return skillConfigMap.get(level);
    }

    //每分钟产生多少学生
    public static int getStudentSpeed(int level){
        SkillConfig skillConfig = skillConfigMap.get(enrolBuildingId).get(level);
        if(skillConfig == null){
            return 0;
        }
        return StringUtils.parseInt(skillConfig.getSkillEffect());
    }

    public static long randomSoulValue(int buildingId,int buildingLevel){
        if(buildingId == enrolBuildingId){
            return 0;
        }
        SkillConfig skillConfig = skillConfigMap.get(buildingId).get(buildingLevel);
        if(skillConfig == null){
            return 0;
        }
        List<Integer> rangeValueList = StringUtils.stringToIntegerList(skillConfig.getSkillEffect(),",");
        return randomHelper.next(rangeValueList.get(0),rangeValueList.get(1));
    }


    //返回对应建筑的等待人数 招待所和魂力检测仪会随着等级翻倍
    public static int getWaitSeat(int buildingId,int buildingSeat){
        List<Integer> seatList = StringUtils.stringToIntegerList(COLLEGE_QUEUE_NUM,"\\|");
        if(buildingId == enrolBuildingId || buildingId == soulCheckBuildingId){
            return buildingSeat * seatList.get(buildingId-1);
        }
        return seatList.get(buildingId-1);
    }

    public static Map<Integer,Long> getBuildingEnterTimeMap(){
        return buildingEnterTimeMap;
    }

    public static Map<Integer,Long> getBuildingStudyTimeMap(){
        return buildingStudyTimeMap;
    }

    public static Integer getBuildingSeat(int buildingId,int level){
        int buildingSeat = buildingSeatMap.get(buildingId).get(level);
        return buildingSeat;
    }

    public static DouLuoShrekProto.ConfigDataTemp.Builder getConfigDataTempBuilder(String language) {
        DouLuoShrekProto.ConfigDataTemp.Builder builder = DouLuoShrekProto.ConfigDataTemp.newBuilder();
        for(Map<Integer, SkillConfig> buildingSkillMap : skillConfigMap.values()){
            for(SkillConfig skillConfig : buildingSkillMap.values()){
                DouLuoShrekProto.SkillConfigTemp.Builder skillBuilder = DouLuoShrekProto.SkillConfigTemp.newBuilder();
                skillBuilder.setType(skillConfig.getType());
                skillBuilder.setLevel(skillConfig.getLevel());
                skillBuilder.setIcon(skillConfig.getIcon());
                skillBuilder.setName(ServerLanguageMgr.getContent(skillConfig.getName(),language));
                skillBuilder.setDesc(ServerLanguageMgr.getContent(skillConfig.getDesc(),language));
                skillBuilder.setCost(skillConfig.getCost());
                skillBuilder.setSkillEffect(skillConfig.getSkillEffect());
                skillBuilder.setWeight(skillConfig.getWeight());
                builder.addSkills(skillBuilder);
            }
        }
        for(Map<Integer, CounterConfig> buildingCounterMap : counterConfigMap.values()){
            for(CounterConfig counterConfig : buildingCounterMap.values()){
                DouLuoShrekProto.CounterConfigTemp.Builder counterBuilder = DouLuoShrekProto.CounterConfigTemp.newBuilder();
                counterBuilder.setType(counterConfig.getType());
                counterBuilder.setLevel(counterConfig.getLevel());
                counterBuilder.setNum(counterConfig.getNum());
                counterBuilder.setConsume(counterConfig.getConsume());
                builder.addCounters(counterBuilder);
            }
        }


        for(TitleConfig titleConfig : titleConfigMap.values()){
            DouLuoShrekProto.TitleConfigTemp.Builder titleBuilder = DouLuoShrekProto.TitleConfigTemp.newBuilder();
            titleBuilder.setId(titleConfig.getId());
            titleBuilder.setIcon(titleConfig.getIcon());
            titleBuilder.setName(ServerLanguageMgr.getContent(titleConfig.getName(),language));
            titleBuilder.setDesc(ServerLanguageMgr.getContent(titleConfig.getDesc(),language));
            titleBuilder.setSourPower(titleConfig.getSourPower());
            titleBuilder.setRewards(titleConfig.getRewards());
            titleBuilder.setAccelerateTimeCost(titleConfig.getAccelerateTimeCost());
            builder.addTitles(titleBuilder);
        }

        for(BeastConfig beastConfig : beastConfigMap.values()){
            DouLuoShrekProto.BeastConfigTemp.Builder beastBuilder = DouLuoShrekProto.BeastConfigTemp.newBuilder();
            beastBuilder.setId(beastConfig.getId());
            beastBuilder.setIcon(beastConfig.getIcon());
            beastBuilder.setName(ServerLanguageMgr.getContent(beastConfig.getName(),language));
            beastBuilder.setDesc(ServerLanguageMgr.getContent(beastConfig.getDesc(),language));
            beastBuilder.setSourPower(beastConfig.getSourPower());
            beastBuilder.setRewards(beastConfig.getRewards());
            builder.addBeasts(beastBuilder);
        }

        for(EventConfig eventConfig : eventConfigMap.values()){
            DouLuoShrekProto.ShrekEventConfigTemp.Builder eventBuilder = DouLuoShrekProto.ShrekEventConfigTemp.newBuilder();
            eventBuilder.setId(eventConfig.getId());
            eventBuilder.setRewards(eventConfig.getRewards());
            eventBuilder.setIcon(eventConfig.getIcon());
            builder.addEvents(eventBuilder);
        }

        return builder;
    }


    @Override
    public boolean reloadData() throws Exception {
        return true;
    }

    @Override
    public boolean init() throws Exception {
        return reload();
    }

    @Override
    public boolean reloadConfig() throws Exception {
        return true;
    }

    @Override
    public boolean stop() {
        return false;
    }

    public static void reloadActivityData() {
        getLogger().info("reload shrek activity start");
        // 获取活动
        ActivityInfo tmpActivityInfo;
        List<ActivityInfo> openActivityInfoList = NormalActivityMgr.getOpenActivityInfoList(eActivityType.DouLuoShrekActivity.getValue());
        if (openActivityInfoList.size() <= 0) {
            getLogger().info("no shrek activity in show time");
            return;
        }
        tmpActivityInfo = openActivityInfoList.get(0);

        Map<Integer, Map<Integer, SkillConfig>> tempSkillMap = DouLuoShrekBusiness.getSkillMap(tmpActivityInfo.getActivityId());
        Map<Integer, Map<Integer, CounterConfig>> tempCounterMap = DouLuoShrekBusiness.getCounterMap(tmpActivityInfo.getActivityId());
        Map<Integer, TitleConfig> tempTitleMap = DouLuoShrekBusiness.getTitleMap(tmpActivityInfo.getActivityId());
        Map<Integer, BeastConfig> tempBeastMap = DouLuoShrekBusiness.getBeastMap(tmpActivityInfo.getActivityId());
        Map<Integer, EventConfig> tempEventMap = DouLuoShrekBusiness.getEventMap(tmpActivityInfo.getActivityId());



        // 活动配置
        Map<String, ActivityConfig> activityConfigMap = NormalActivityMgr.getActivityConfigMap(tmpActivityInfo.getActivityId());
        if(activityConfigMap != null){
            if(activityConfigMap.containsKey("COLLEGE_SCORE_ITEM_ID")){
                COLLEGE_SCORE_ITEM_ID = activityConfigMap.get("COLLEGE_SCORE_ITEM_ID").getIntValue();
            }
            if(activityConfigMap.containsKey("COLLEGE_COST_NUM_ID")){
                COLLEGE_COST_NUM_ID = activityConfigMap.get("COLLEGE_COST_NUM_ID").getIntValue();
            }
            if(activityConfigMap.containsKey("COLLEGE_QUEUE_NUM")){
                COLLEGE_QUEUE_NUM = activityConfigMap.get("COLLEGE_QUEUE_NUM").getValue();
            }
            if(activityConfigMap.containsKey("COLLEGE_PROCESS_TIME")){
                COLLEGE_PROCESS_TIME = activityConfigMap.get("COLLEGE_PROCESS_TIME").getValue();
            }
            if(activityConfigMap.containsKey("COLLEGE_WALK_TIME")){
                COLLEGE_WALK_TIME = activityConfigMap.get("COLLEGE_WALK_TIME").getValue();
            }
            if(activityConfigMap.containsKey("COLLEGE_COUNTER_UNLOCK_TIME")){
                COLLEGE_COUNTER_UNLOCK_TIME = activityConfigMap.get("COLLEGE_COUNTER_UNLOCK_TIME").getLongValue();
            }
            if(activityConfigMap.containsKey("COLLEGE_SKILL_NAME_NUM")){
                COLLEGE_SKILL_NAME_NUM = activityConfigMap.get("COLLEGE_SKILL_NAME_NUM").getIntValue();
            }
            if(activityConfigMap.containsKey("COLLEGE_EVENT_REFRESH_TIME")){
                COLLEGE_EVENT_REFRESH_TIME = activityConfigMap.get("COLLEGE_EVENT_REFRESH_TIME").getIntValue();
            }
            if(activityConfigMap.containsKey("COLLEGE_BATTLE_QUICK_OPEN_LIMIT")){
                COLLEGE_BATTLE_QUICK_OPEN_LIMIT = activityConfigMap.get("COLLEGE_BATTLE_QUICK_OPEN_LIMIT").getLongValue();
            }

            processTimeMap = new ConcurrentHashMap<>();
            List<Long> processTimeList = StringUtils.stringToLongList(COLLEGE_PROCESS_TIME, "\\|");
            for(int i = 0 ; i < processTimeList.size() ; i++){
                processTimeMap.put(i+1,processTimeList.get(i));
            }

            walkTimeMap = new ConcurrentHashMap<>();
            List<Long> walkTimeList = StringUtils.stringToLongList(COLLEGE_WALK_TIME, "\\|");
            for(int i = 0 ; i < processTimeList.size() ; i++){
                walkTimeMap.put(i+1,walkTimeList.get(i));
            }

        }
        initConfig(tempSkillMap,tempCounterMap,tempTitleMap,tempBeastMap,tempEventMap);
        activityInfo = tmpActivityInfo;

        reloadPlayerData();
        getLogger().info("reload shrek activity end");
    }



    private static void reloadPlayerData() {
        if (ActivityMgr.activityInShowTime(activityInfo)) {
            for (GamePlayer player : GamePlayerMgr.getCopyPlayerMap().values()) {
                if (SystemOpenMgr.systemOpen(player, eSystemId.DouLuoShrekActivity.getValue())) {
                    DouLuoShrekModule module = player.getModule(DouLuoShrekModule.class);
                    module.initUserData(activityInfo.getActivityId());
                    module.syncConfigData();
                    module.syncUserData();
                }
            }
        }
    }

    private static void initConfig(Map<Integer, Map<Integer, SkillConfig>> tempSkillMap,Map<Integer, Map<Integer, CounterConfig>> tempCounterMap,Map<Integer, TitleConfig> tempTitleMap,Map<Integer, BeastConfig> tempBeastMap,Map<Integer, EventConfig> tempEventMap){
        Map<Integer,Long> tempBuildingStudyTimeMap = new ConcurrentHashMap<>();
        Map<Integer,Long> tempBuildingEnterTimeMap = new ConcurrentHashMap<>();

        long totalTime = 0L;
        for(int buildingId : processTimeMap.keySet()){
            tempBuildingStudyTimeMap.put(buildingId,processTimeMap.get(buildingId));
            if(walkTimeMap.containsKey(buildingId)){
                totalTime += walkTimeMap.get(buildingId);
            }
            if(processTimeMap.containsKey(buildingId-1)){
                totalTime += processTimeMap.get(buildingId-1);
            }
            tempBuildingEnterTimeMap.put(buildingId,totalTime);
        }

        Map<Integer,Map<Integer,Integer>> tempBuildingSeatMap = new ConcurrentHashMap<>();
        for(int buildingId : tempCounterMap.keySet()){
            tempBuildingSeatMap.put(buildingId,new ConcurrentHashMap<>());
            for(CounterConfig counterConfig : tempCounterMap.get(buildingId).values()){
                tempBuildingSeatMap.get(buildingId).put(counterConfig.getLevel(),counterConfig.getNum());
            }
        }

        for(TitleConfig titleConfig : tempTitleMap.values()){
            List<Long> soulRangeList =  StringUtils.stringToLongList(titleConfig.getSourPower(),",");
            titleConfig.setSmallValue(soulRangeList.get(0));
            titleConfig.setBigValue(soulRangeList.get(1));
        }

        for(BeastConfig beastConfig : tempBeastMap.values()){
            List<BigInteger> paramsList =  StringUtils.stringToBigIntegerList(beastConfig.getSourPower(),",");
            beastConfig.setBlood(paramsList.get(0));
            beastConfig.setKillTimes(paramsList.get(1).intValue());
        }

        for(EventConfig eventConfig : tempEventMap.values()){
            List<String> rewardList =  StringUtils.stringToStringList(eventConfig.getRewards(),"\\|");
            eventConfig.setRewardList(rewardList);
        }

        buildingStudyTimeMap = tempBuildingStudyTimeMap;
        buildingEnterTimeMap = tempBuildingEnterTimeMap;

        buildingSeatMap = tempBuildingSeatMap;

        skillConfigMap = tempSkillMap;
        counterConfigMap = tempCounterMap;
        titleConfigMap = tempTitleMap;
        beastConfigMap = tempBeastMap;
        eventConfigMap = tempEventMap;
    }

    /**
     * 是否在清空道具时间内
     */
    public static boolean isActivityInClearTime() {
        return ActivityMgr.activityInRewardPeriod(activityInfo);
    }

    /**
     * 获取展示中的活动ID（0表示没活动）
     */
    public static int getActivityTimeAcId() {
        if(activityInShowTime()){
            return activityInfo.getActivityId();
        }
        return 0;
    }

    public static boolean activityInTime(){
        return ActivityMgr.activityInTime(activityInfo);
    }

    public static boolean activityInShowTime(){
        return ActivityMgr.activityInShowTime(activityInfo);
    }

    public static ActivityInfo getActivityInfo() {
        return activityInfo;
    }

}
